package com.inlycat.entity;

import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.Past;

import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author jarvan4dev@163.com
 * @since 2015年8月12日上午11:41:12
 * @category 影评实体类
 */

//json转换的时候，用于过滤null字段
//@JsonInclude(Include.NON_NULL)
public class Comment implements Serializable {

	private static final long serialVersionUID = -3424236362913873400L;
	/**
	 * 影评ID
	 */
	private Long id;
	/**
	 * 评论内容
	 */
	@Length(max = 100, message = "{comment.content.length}")
	private String content;
	/**
	 * 评论创建时间
	 */
	@Past(message = "{comment.createTime.past}")
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")//格式化日期
	private Date createTime;

	/**
	 * 评论人
	 */
	private User user;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Override
	public String toString() {
		return "Comment [id=" + id + ", content=" + content + ", createTime="
				+ createTime + ", user=" + user + "]";
	}

}
